package primetest.impl.controler;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;



import javax.enterprise.context.SessionScoped;
import javax.inject.Named;





@Named("genderListControler")
@SessionScoped
public class GenderListControler implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = -4992396044969902173L;

	/**
	 *
	 */




	public class Gender {
		private String label;
		private int value;
		public Gender(String label, int value) {
			this.setLabel(label);
			this.setValue(value);
		}
		public String getLabel() {
			return label;
		}
		public void setLabel(String label) {
			this.label = label;
		}
		public int getValue() {
			return value;
		}
		public void setValue(int value) {
			this.value = value;
		}
	}

	private List<Gender> genderList;

	public List<Gender> getGenderList() {
		if (genderList == null) {
			genderList = new ArrayList<Gender>();
			genderList.add(new Gender("Male", 1));
			genderList.add(new Gender("Female", 2));
		}
		return genderList;
	}

	public String getGenderById(int id) {
		if (id == 1) {
			return "Male";
		} else {
			return "Female";
		}
	}
}
